//
//  YKUMSDK+Push.m
//  YKUMSDK
//
//  Created by linghit on 2022/11/1.
//

#import "YKUMSDK+Push.h"
#import <UMPush/UMessage.h>

@implementation YKUMSDK (Push)

+ (void)push_registWith:(NSDictionary * __nullable)launchOptions
 completionHandler:(void (^ __nullable)(BOOL granted, NSError *_Nullable error))completionHandler
{
    UMessageRegisterEntity* entity =[[UMessageRegisterEntity alloc] init];
    entity.types = UMessageAuthorizationOptionBadge|UMessageAuthorizationOptionSound|UMessageAuthorizationOptionAlert;
    [UMessage registerForRemoteNotificationsWithLaunchOptions:launchOptions Entity:entity completionHandler:completionHandler];
}

+ (void)push_registerDeviceToken:(NSData * __nullable)deviceToken
{
    [UMessage registerDeviceToken:deviceToken];
}

+ (void)push_setBadgeClear:(BOOL)value
{
    [UMessage setBadgeClear:value];
}

+ (void)push_setAutoAlert:(BOOL)value
{
    [UMessage setAutoAlert:value];
}

+ (void)push_sendClickReportForRemoteNotification:(NSDictionary * __nullable)userInfo
{
    [UMessage sendClickReportForRemoteNotification:userInfo];
}
@end
